{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from math import sqrt\n",
    "import matplotlib.pyplot as plt\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def mean(values):\n",
    "  return sum(values) / float(len(values))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def variance(values, mean):\n",
    "  return sum([(x-mean)**2 for x in values])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def covariance(x, mean_x, y, mean_y):\n",
    "  covar = 0.0\n",
    "  for i in range(len(x)):\n",
    "    covar += (x[i] - mean_x) * (y[i] - mean_y)\n",
    "  return covar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def coefficients(dataset):\n",
    "      x = [row[0] for row in dataset]\n",
    "      y = [row[1] for row in dataset]\n",
    "      x_mean, y_mean = mean(x), mean(y)\n",
    "      b1 = covariance(x, x_mean, y, y_mean) / variance(x, x_mean)\n",
    "      b0 = y_mean - b1 * x_mean\n",
    "      return [b0, b1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def simple_linear_regression(train, test):\n",
    "  predictions = list()\n",
    "  b0, b1 = coefficients(train)\n",
    "  for row in test:\n",
    "    ypred = b0 + b1 * row[0]\n",
    "    predictions.append(ypred)\n",
    "  return predictions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def rmse_metric(actual, predicted):\n",
    "  sum_error = 0.0\n",
    "  for i in range(len(actual)):\n",
    "    prediction_error = predicted[i] - actual[i]\n",
    "    sum_error += (prediction_error ** 2)\n",
    "  mean_error = sum_error / float(len(actual))\n",
    "  return sqrt(mean_error)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def evaluate_algorithm(train_dataset, test_dataset, algorithm):\n",
    "  predicted = algorithm(train_dataset, test_dataset)\n",
    "  actual = [row[-1] for row in test_dataset]\n",
    "  rmse = rmse_metric(actual, predicted)\n",
    "  return rmse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def load_csv(file):\n",
    "    x = []\n",
    "    y = []\n",
    "    for line in file:\n",
    "        x.append(float(line.split(',')[0]))\n",
    "        y.append(float(line.split(',')[1]))\n",
    "    return (x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x, y = load_csv(open('insurance.csv'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "insuranceDs = [[x[i], y[i]] for i in range(len(x))]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def split_train_test(dataset, splitRatio):\n",
    "    trainSize = int(len(dataset) * splitRatio)\n",
    "    trainSet = []\n",
    "    copy = list(dataset)\n",
    "    while len(trainSet) < trainSize:\n",
    "        index = random.randrange(len(copy))\n",
    "        trainSet.append(copy.pop(index))\n",
    "    return [trainSet, copy]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "trainSet, testSet = split_train_test(insuranceDs, 0.6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "predicted = simple_linear_regression(trainSet, testSet)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAG9BJREFUeJzt3XuQHOV57/HvszurlbxKLFtIHF3Q\nrYyJ7I2DZEXoxFkXoPggMLHkxKRQDFYcLpXCJ7FwKrF8TEUmJBU7N+TUCfbhYkcOtmUfZAQxjhQM\ncqx/QNGFIGFZQQEvuplVZCDRGqSdnSd/dLcYVrMzPbs9M909v0+VSjM9vbNvz+w+8+7zvu/zmrsj\nIiL51dHqBoiISGMp0IuI5JwCvYhIzinQi4jknAK9iEjOKdCLiOScAr2ISM4p0IuI5JwCvYhIzhVa\n3QCA8847z+fNm9fqZoiIZMru3bv/w92n1TovFYF+3rx57Nq1q9XNEBHJFDPrj3OeUjciIjmnQC8i\nknMK9CIiOZeKHL2ISDvpPznIPTueY8veYwyeLtLTXWDVopnc1LeAuVN7Ev9+CvQiIk20/eAAt9y/\nh6HhEsVSsB/IqdNFNu08zObdR7nrusVcdtH0RL+nUjciIk3Sf3KQW+7fw6tDw2eDfKRYcl4dGuaW\n+/fQf3Iw0e+rQC8i0iT37HiOoeFS1XOGhkvcu+P5RL+vAr2ISJNs2XvsnJ78SMWS8+Deo4l+XwV6\nEZEmGTxdjHfemXjnxaVALyLSJD3d8ea/9ExIdp6MAr2ISJOsWjSTQodVPafQYXxw0axEv68CvYhI\nk9zUt4Cuzupht6uzgxv75if6fRXoRUSaZO7UHu66bjGTujrP6dkXOoxJXZ3cdd3ixBdNKdCLiDTR\nZRdNZ+vaPlYvncPk7gJmMLm7wOqlc9i6ti/xxVIA5l59qk8zLFmyxFWm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PMvE/zZ9jTwVPjvKoIc92PAs+H/b211W2Nez6XAt8PbCwh+\ngA8B/x/obnX7arT9YmBX+F5sAd6StfcBuB34IbAf+HugO+3vA/B1gjGFIYLe7g2jve4EaY+/DX/H\n9xHMMErrNRwiyMVHv9dfLDv/0+E1HASubHZ7tTJWRCTnspy6ERGRGBToRURyToFeRCTnFOhFRHJO\ngV5EJOcU6EVEck6BXkQk5xToRURy7r8BNv/KnM+uZKsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fbb0cedfe10>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x, y, alpha = 1, s = 100)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAHYRJREFUeJzt3Xl4VPXZ//H3zSbiAiKLFIgBAUUR\nUSKouLAosj0/a6ttqfuGPuKjVq0CLqBWRVu1rbW2WBfsT61YqvIoKotQtIoKAgICshgUoUQWBUWD\nSe7njzlMM2OQkJnJmTnzeV0XV/K9M5PcR+OH23NmvsfcHRERia46YTcgIiKZpaAXEYk4Bb2ISMQp\n6EVEIk5BLyIScQp6EZGIU9CLiEScgl5EJOIU9CIiEVcv7AYAmjVr5oWFhWG3ISKSU+bOnbvB3Zvv\n6nFZEfSFhYXMmTMn7DZERHKKma2uzuN06kZEJOIU9CIiEaegFxGJOAW9iEjEKehFRCJOQS8iEnEK\nehGRiFPQi4iEoKLCuWbCfCYvXJfxn5UVb5gSEcknbyzfwNmPvA3AlMXrGXR4q4z+PAW9i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DywiAr+XleX0\nG6bMbBCx6aIu8Ki73xFySykxs6eB3sR2z1sPjAaeByYABcDHwJnunnzBNuuZ2fHA68BC/nOudxSx\n8/Q5fXxm1pXYBbu6xIanCe5+m5m1JzYFNwXmAWe7e2l4naYmOHVznbsPicqxBcfxXLCsBzzl7neY\n2f7k+O9lZTkd9CIismu5fOpGRESqQUEvIhJxCnoRkYhT0IuIRJyCXkQk4hT0IiIRp6AXEYk4Bb2I\nSMT9HyPw6E3Sj49GAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fbb0cedfbe0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "xForTestSet = [testSet[i][0] for i in range(len(testSet))]\n",
    "\n",
    "plt.plot(xForTestSet, predicted)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "RMSE Metric for SimpleLinearRegression = 44.14896022843808\n"
     ]
    }
   ],
   "source": [
    "rmse = evaluate_algorithm(trainSet, testSet, simple_linear_regression)\n",
    "print('RMSE Metric for SimpleLinearRegression = {0}'.format(rmse))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def baseline_linear_regression(train, test):\n",
    "  predictions = list()\n",
    "  for row in test:\n",
    "    yTrain = [train[i][-1] for i in range(len(train))]\n",
    "    ypred = mean(yTrain) * row[0]\n",
    "    predictions.append(ypred)\n",
    "  return predictions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "predicted = baseline_linear_regression(trainSet, testSet)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAA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9xHMMErrNRwiyMVHv9dfLDv/0+E1HASubHZ7tTJWRCTnspy6ERGRGBToRURyToFeRCTnFOhFRHJO\ngV5EJOcU6EVEck6BXkQk5xToRURy7r8BNv/KnM+uZKsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fbb0cd4be80>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x, y, alpha = 1, s = 100)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAHwxJREFUeJzt3Xl4VPXZ//H3zSa4sYggshgoUHHB\nbQQVFwSNLD4PttVWaxWtFvurfbRVHwsuBcEF7a+1ahUfKir6c0OthUtRCAgPWkUJIsqmREWJUEBB\nFlEw5P79MSfjnCGQkExyZvm8rosr871zMnOfy3g+3znn5Dvm7oiISP5pEHUDIiISDQWAiEieUgCI\niOQpBYCISJ5SAIiI5CkFgIhInlIAiIjkKQWAiEieUgCIiOSpRlE3sDutW7f2goKCqNsQEckq8+fP\n/8LdD6xqu4wOgIKCAoqLi6NuQ0Qkq5jZp9XZrlqngMyshZk9Z2bLzGypmZ1oZq3MrMjMlgdfWwbb\nmpnda2YlZvaemR2b9DxDg+2Xm9nQmu2aiIikQ3WvAdwDvOLuhwJHAUuB4cBMd+8GzAzGAAOBbsG/\nYcA4ADNrBYwEegO9gJEVoSEiIvWvygAws/2BU4EJAO6+3d2/AoYAE4PNJgLnBI+HAI953FyghZm1\nA84Citx9vbtvAIqAAWndGxERqbbqvAPoAqwDHjGzBWb2kJ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jZvsCzwO/c/dN8clk9nP3HcDRZtYC\neAHoUdlm9dtV7ZnZ2cBad59vZn0rypVsmnX7lqSPu68yszZAkZkti7qhdMvFdwBVfvB8jlhjZu0A\ngq9rI+6nxsysMfGD/xPu/o+gnDP7B+DuXwGziV/naGFmFZOvbP397AP8p5mtIH6atR/xdwS5sG8A\nuPuq4Ota4uHdixz7vczFAMiXD56fAgwNHg8FJkfYS40F540nAEvd/S9J38r6/TOzA4OZP2bWDDiD\n+DWOWcC5wWZZuW/uPsLdO7h7AfH/x1519wvJgX0DMLN9zGy/isdAIbCIHPi9TJaTfwhmZoOIz0Yq\nPnj+tohbqhUzewroS3w1wjXASOCfwCSgE/AZcJ67p14oznhmdjLwGvA+359LvoH4dYCs3j8z60n8\nQmFD4pOtSe4+2sy6EJ81twIWAL9w923RdVo7wSmg69z97FzZt2A/XgiGjYAn3f02MzuALP+9TJaT\nASAiIlXLxVNAIiJSDQoAEZE8pQAQEclTCgARkTylABARyVMKABGRPKUAEBHJUwoAEZE89f8BE+dA\n0CWjjRsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fbb0cd21c50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(xForTestSet, predicted)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "RMSE Metric for BaseLineLinearRegression = 2401.892645483708\n"
     ]
    }
   ],
   "source": [
    "rmse = evaluate_algorithm(trainSet, testSet, baseline_linear_regression)\n",
    "print('RMSE Metric for BaseLineLinearRegression = {0}'.format(rmse))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
